package com.dragon8869.myspringboot.mq.producer;

import com.dragon8869.myspringboot.entity.AyMood;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.jms.Destination;

@Service
public class AyMoodProducer {
    @Resource
    JmsMessagingTemplate jmsMessagingTemplate;

    public void sendMessage(Destination destination, String message){
        jmsMessagingTemplate.convertAndSend(destination, message);
    }

    public void sendMessage(Destination destination, AyMood message){
        jmsMessagingTemplate.convertAndSend(destination, message);
    }
}
